<template>
    <div>
        <van-nav-bar title="我的收货地址" left-text="返回" left-arrow @click-left="onClickLeft" />

        <van-address-list v-model="chosenAddressId" :list="list" @select="onSelect" />

    </div>
</template>

<script setup>
import axios from 'axios';
import { onMounted, ref } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter()

const onClickLeft = () => history.back();
const list = ref([])
const chosenAddressId = ref('1');

const onSelect = (item, index) => {
    router.push({
        path: '/order',
        query: item
    })
    
}
const getData = () => {
    axios.get('/api/list3').then(res => {
        list.value = res.data
    })
}

onMounted(() => {
    getData()
})


</script>